# 数据库模型模块初始化文件
# 该文件使Python将models目录视为一个包(package)
# 包含应用的所有数据库模型定义

from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column
from .base import Base, BaseModelMixin
from .kpl_stock import KPLStock

__all__ = ["Base", "BaseModelMixin", "KPLStock"]


class User(Base, BaseModelMixin):
    """
    用户模型
    """
    __tablename__ = "users"
    
    username: Mapped[str] = mapped_column(String(50), unique=True, index=True)
    email: Mapped[str] = mapped_column(String(100), unique=True, index=True)
    hashed_password: Mapped[str] = mapped_column(String(100))
    
    def __repr__(self):
        return f"<User(id={self.id}, username='{self.username}')>"